Jump to content

Selenium/How-to/Record videos of test runs

From mediawiki.org

This page will assume you know how to run Selenium tests. If not, see Selenium/Getting Started/Run tests targeting MediaWiki-Docker.

Recording videos is currently supported only on Linux, and is triggered by the DISPLAY value starting with a colon.

Fresh

[edit]

We recommend running tests in a Fresh container. For more information see Selenium/Getting Started/Run tests using Fresh.

fresh-node -env -net

Ubuntu

[edit]

If you're not using a a Fresh container, you can also record videos on a Linux, for example Ubuntu.

Install dependencies.

sudo apt install ffmpeg xvfb

Environment variables

[edit]
export DISPLAY=:1
Xvfb "$DISPLAY" -nolisten unix -screen 0 1280x1024x24 &

Run Selenium tests

[edit]
npm run selenium-test

Videos

[edit]

Videos are located in tests/selenium/log/ folder. You can play them using a video player like VLC.

ls -1 tests/selenium/log/*.mp4

tests/selenium/log/BlankPage-should-have-its-title-%40daily-2021-05-27T14-22-04-403Z.mp4
tests/selenium/log/Page-should-be-creatable-2021-05-27T14-20-00-133Z.mp4
tests/selenium/log/Page-should-be-deletable-2021-05-27T14-20-29-727Z.mp4
tests/selenium/log/Page-should-be-editable-%40daily-2021-05-27T14-20-17-105Z.mp4
tests/selenium/log/Page-should-be-previewable-2021-05-27T14-19-46-327Z.mp4
tests/selenium/log/Page-should-be-re-creatable-2021-05-27T14-20-08-786Z.mp4
tests/selenium/log/Page-should-be-restorable-2021-05-27T14-20-39-245Z.mp4
tests/selenium/log/Page-should-have-history-%40daily-2021-05-27T14-20-22-589Z.mp4
tests/selenium/log/Special%3ARecentChanges-shows-page-creation-2021-05-27T14-20-58-591Z.mp4
tests/selenium/log/Special%3AWatchlist-should-show-page-with-new-edit-2021-05-27T14-21-44-397Z.mp4
tests/selenium/log/User-should-be-able-to-create-account-2021-05-27T14-21-17-458Z.mp4
tests/selenium/log/User-should-be-able-to-log-in-%40daily-2021-05-27T14-21-24-407Z.mp4

More information

[edit]